web: All tabs closed when any note is deleted.#9252
Open
NeedsChloesure wants to merge 2 commits intostreetwriters:betafrom
Open
web: All tabs closed when any note is deleted.#9252NeedsChloesure wants to merge 2 commits intostreetwriters:betafrom
NeedsChloesure wants to merge 2 commits intostreetwriters:betafrom
Conversation
Signed-off by: Chloe Oletto <NeedsChloesure@riseup.net>
thecodrr
requested changes
Jan 22, 2026
apps/web/src/stores/editor-store.ts
Outdated
| const clearIds: string[] = []; | ||
| for (const session of sessions) { | ||
| if (session.type === "new") continue; | ||
| if (session.note.id !== item.id) continue; |
Contributor
There was a problem hiding this comment.
The check on line 297 is doing the same thing.
Contributor
Author
There was a problem hiding this comment.
I removed the check on line 297 and definition of NoteId. NoteId isn't set when the note is deleted, which makes the check following the definition fail. Why check if the incoming item is deleted before grabbing it's ID? Isn't it just faster to check the IDs up front? Are there cases where we do not have this information available in item?
For the potential edge case where a content ID is passed here, wouldn't the note ID still follow (or already gone through)?
db80c61 to
87a8fc7
Compare
…are reopened. Signed-off By: Chloe Oletto <NeedsChloesure@riseup.net>
87a8fc7 to
dd3253c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The logic was missing a check to ensure that only the tabs that correspond to the recently deleted object were being marked for closure. The lack of this check meant that for any deleted note item, all tabs would pass the
if (isDeleted(item) || isTrashItem(item))check since the open tab loop runs on every tab for every item.